<section class="comments">
      <h1>评论<span>已有<a class="count" href="${base}/comment.jspx?contentId=${content.id}">
      ${content.commentsCheckedNum!} </a>条</span>
      </h1>
      [#if content.channel.commentControl==0 || ((content.channel.commentControl==1||content.channel.commentControl==3))]
      <form id="commentForm" action="${base}/comment.jspx" method="post">
      <div style="margin-top:20px;">评分：
        <input name="score" type="radio" value="1"/>1分
      	<input name="score" type="radio" value="2"/>2分
      	<input name="score" type="radio" value="3"/>3分
      	<input name="score" type="radio" value="4"/>4分
      	<input name="score" type="radio" value="5" checked="checked"/>5分
      </div>
      <textarea name="text" placeholder="发表你此时的观点和想法 ……" class="comments-text" id="comments-text" style="margin-top:10px;"></textarea>
       [#if user??&&user.group.needCaptcha||!user??]
	    <div class="plfr1 clearfix">
	    <div style="float:left;">
	    <input name="captcha" type="text" placeholder="验证码" id="captcha" vld="{required:true}" class="plcode"/>
	    </div>
	    <div style="float:left;">
	    <img id="commentCaptcha" src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()"/>
	    </div>
	 [/#if]
	    <div class="down clearfix">
       <input type="hidden" name="contentId" value="${content.id}" />
      <input type="submit" name="Submit" value="提交评论" class="submit-on" />
      </div>
               </div>


       </form>
       <script type="text/javascript">
$(function() {
/*
	$("#commentForm").validate( {
		submitHandler : function(form) {
			$(form).ajaxSubmit( {
				"success" : function(data) {
					if(data.success) {
						alert("评论成功");
						location.href=location.href;
					} else {
						alert("评论失败");
					}
				},
				"dataType" : "json"
			});
		}
	});
*/
	Cms.comment(function(data) {
		if(data.status==0) {
			alert("评论成功");
			location.href=location.href;
		} else if(data.status==1) {
			alert("验证码错误");
			$("#commentCaptcha").click();
		} else if(data.status==2) {
			alert("内容不存在");
			$("#commentCaptcha").click();
		} else if(data.status==3) {
			alert("评论关闭");
			$("#commentCaptcha").click();
		} else if(data.status==4) {
			alert("需要登录评论");
			$("#commentCaptcha").click();
		}else if(data.status==5) {
			alert("已经评论过，不能重复评论");
			$("#commentCaptcha").click();
		} else if(data.status==100) {
			alert("内容不存在");
			$("#commentCaptcha").click();
		} else if(data.status==101) {
			alert("评论不能为空");
			$("#commentCaptcha").click();
		} else {
			alert("评论失败");
			$("#commentCaptcha").click();
		}
	});
});
</script>
    [#elseif content.channel.commentControl==1 && !user??]
    [#--登录评论，且未登录--]
    <div class="down clearfix">
    <img src="/${res}/images/userImg.png" class="userImg"><span>
    <a href="${base}/login.jspx?returnUrl=/">登录</a>之后才能发表评论</span>
    </div>
    [#else]
    [#--不允许评论--]
    [/#if]
</section>







